package com.hex.ds.hdtp.core.inf.data.table.repository;

import com.hex.ds.hdtp.core.inf.common.page.Page;
import com.hex.ds.hdtp.core.inf.common.repository.IBasicRepository;
import com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo;

import java.sql.Clob;
import java.util.List;

/**
 * @Package com.hex.ds.hdtp.core.inf.data.table.repository
 * @ClassName ITableTransferListRepository
 * @Description 表迁移清单-数据服务接口
 * @Author Wang zhihao
 * @Date 2023/8/9 11:13
 * @Version v1.0
 **/
public interface ITableTransferListRepository extends IBasicRepository<TableTransferListPo> {

    /**
     * @Method queryListByPage
     * @Param
     * @param tableTransferListPo
     * @param toPage
     * @Return com.hex.ds.hdtp.core.inf.common.page.Page<com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo>
     * @Description 表迁移清单-分页查询
     * @Author Wang zhihao
     * @Date 2023/8/9 11:12
     * @Version V1.0
     */
    Page<TableTransferListPo> queryListByPage(TableTransferListPo tableTransferListPo, Page toPage);

    /**
     * 根据任务主键分页查询
     *
     * @param tableTransferListPo
     * @param toPage
     * @return
     */
    Page<TableTransferListPo> queryPageListByTaskId(TableTransferListPo tableTransferListPo, Page toPage);

    /**
     * @Method queryList
     * @Param
     * @param tableTransferListPo
     * @Return java.util.List<com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo>
     * @Description 表迁移清单-不分页查询
     * @Author Wang zhihao
     * @Date 2023/8/10 14:30
     * @Version V1.0
     */
    List<TableTransferListPo> queryList(TableTransferListPo tableTransferListPo);


    /**
     * @Method queryLatestTransferTable
     * @Param
     * @Param sourceDbName
     * @Param sourceTableName
     * @Return java.util.List<com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo>
     * @Description 根据源库名表名查询最新的迁移表信息
     * @Author gj.xu
     * @Date 2023/8/29 11:42
     * @Version V2.0
     */
    TableTransferListPo queryLatestTransferTable(String sourceDbName, String sourceTableName);

    /**
     * @Method queryLatestTransferTable
     * @Param
     * @Param targetDbName
     * @Param targetTableName
     * @Return java.util.List<com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo>
     * @Description 根据目标库名表名查询最新的迁移表信息
     * @Author Yin.Yang
     * @Date 2023/9/27 16:42
     * @Version V1.0
     */
    TableTransferListPo queryLatestTransferTableByTarget(String targetDbName, String targetTableName, String targetPkId);

    /**
     * @Method removeByTaskPkId
     * @Param
     * @param taskPkId
     * @Return void
     * @Description 表迁移清单-根据任务主键删除
     * @Author Wang zhihao
     * @Date 2023/8/9 19:33
     * @Version V1.0
     */
    void removeByTaskPkId(String taskPkId);

    /**
     * @Method addWithBackId
     * @Param
     * @param tableTransferListPo
     * @Return java.lang.String
     * @Description 新增并返回主键
     * @Author Wang zhihao
     * @Date 2023/8/14 10:04
     * @Version V1.0
     */
    String addWithBackId(TableTransferListPo tableTransferListPo);

    /**
     * @Method queryLatestSuccess
     * @Param
     * @param tableTransferListPo
     * @param toPage
     * @Return com.hex.ds.hdtp.core.inf.common.page.Page<com.hex.ds.hdtp.core.inf.data.table.po.TableTransferListPo>
     * @Description 表迁移清单-分页查询每个建表最新成功的
     * @Author Wang zhihao
     * @Date 2023/8/28 11:10
     * @Version V1.0
     */
    Page<TableTransferListPo> queryLatestSuccess(TableTransferListPo tableTransferListPo, Page toPage);
}
